<form class="form-horizontal" id="form-add-category">
    <div class="form-group">
        <label class="control-label col-xs-2">
            所属联盟商
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            {include file="public/unionSerarch" union-num-name="union_id" /}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            折扣券标题
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="title" value="{$info.title}" placeholder="输入折扣券标题" required>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            背景色
        </label>
        <div class="col-xs-9">
            {include file="public/colorUploader" color-name="thumb" /}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            卡券折扣
            <span style="color: #FF0000;">* %</span>
        </label>
        <div class="col-xs-9">
            <input type="number" class="form-control" name="discount" value="{$info.discount}" placeholder="请输入卡券折扣，纯数字，如98 则98% 即100元打折后为98元" required>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">分类排序</label>
        <div class="col-xs-9">
            <input type="number" class="form-control" value="{$info.display_order}" name="order" placeholder="输入分类序号，序号越高，显示越靠前">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">是否显示</label>
        <div class="col-xs-9">
            <div class="btn-group" data-toggle="buttons">
                <label class="btn btn-default {if condition='$info.is_visible==1'}active{/if}">
                    <input type="radio" name="visible" id="visible_1" value="1" {if condition='$info.is_visible==1'}checked{/if}> 显示
                </label>
                <label class="btn btn-default {if condition='$info.is_visible==0'}active{/if}">
                    <input type="radio" name="visible" id="visible_0" value="0" {if condition='$info.is_visible==0'}checked{/if}> 隐藏
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-xs-offset-2 col-xs-3">
            <input type="hidden" name="id" value="{$info.id}">
            <button type="submit" class="btn btn-success btn-block">确认编辑</button>
        </div>
    </div>
</form>

<script src="__PUBLIC__/vendors/jquery.validation/jquery.validate.min.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/additional-methods.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/messages_zh.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#form-add-category").validate({
            messages:
                {
                    title: "请输入折扣券标题",
                    discount:"请输入卡券折扣"
                },
            debug: true,
            submitHandler: function () {
                ajaxSubmit('form-add-category', true);
            }
        });
    })
</script>